class Request {
 constructor(success, code, message, data, total) {
  this.code = code;
  this.success = success;
  this.message = message;
  this.data = data
  this.total = total
 }
 static ok(data) {
  if (data && data.total != undefined && data.docs) {
   return new Request(true, 200, '操作成功', data.docs, data.total)
  }
  return new Request(true, 200, '操作成功', data)
 }
 static err(message, code) {
  return new Request(false, code || 500, message || '操作失败')
 }
}
module.exports = Request